<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/22
 * Time: 13:31
 */
namespace phpfuntions\mp_net;
//其他操作类Network 函数　

class myphp_network_others
{
    /**
     * fsockopen 函数：打开网络Socket连接　
     * @access public
     * @return
     */
    public static function fsockopen ($hostname, $port = null, &$errno = null, &$errstr = null, $timeout = null) {
        return fsockopen( $hostname, $port,$errno ,$errstr , $timeout );

    }

    /**
     * inet_ntop 函数：把网络IP地址转换为可识别的形式
     * @access public
     * @return
     */
    public static function inet_ntop ($in_addr) {
        return inet_ntop( $in_addr);

    }

    /**
     * inet_pton 函数：把可识别形式的IP地址转换为网络IP　
     * @access public
     * @return
     */
    public static function inet_pton ($address) {
        return inet_pton( $address);

    }

    /**
     * ip2long 函数：把IP地址转换为一个整数　
     * @access public
     * @return
     */
    public static function ip2long ($ip_address) {
        return ip2long($ip_address );

    }

    /**
     * long2ip 函数：把一个整数转换为IP地址　
     * @access public
     * @return
     */
    public static function long2ip ($proper_address) {
        return long2ip($proper_address );

    }

    /**
     * pfsockopen 函数：打开网络Socket持续连接　
     * @access public
     * @return
     */
    public static function pfsockopen ($hostname, $port = null, &$errno = null, &$errstr = null, $timeout = null) {
        return pfsockopen($hostname, $port , $errno , $errstr , $timeout  );

    }
}